package action;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import vo.DogBean;
import dao.DogDao;

public class DogListAction implements DogAction {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) {
		DogDao dao = new DogDao();
		ArrayList<DogBean> list = dao.getList();
		request.setAttribute("list", list);
		RequestDispatcher dis = request.getRequestDispatcher("./dogList.jsp");
		try {
			dis.forward(request, response);
		} catch (ServletException | IOException e) {
			e.printStackTrace();
		}
	}//exe
}//class
